class YbzcsController < ApplicationController
  before_action :set_ybzc, only: [:show, :edit, :update, :destroy]

  # GET /ybzcs
  # GET /ybzcs.json
  def index
    @ybzcs = Ybzc.all
  end

  # GET /ybzcs/1
  # GET /ybzcs/1.json
  def show
  end

  # GET /ybzcs/new
  def new
    @ybzc = Ybzc.new
  end

  # GET /ybzcs/1/edit
  def edit
  end

  # POST /ybzcs
  # POST /ybzcs.json
  def create
    @ybzc = Ybzc.new(ybzc_params)

    respond_to do |format|
      if @ybzc.save
        format.html { redirect_to @ybzc, notice: 'Ybzc was successfully created.' }
        format.json { render :show, status: :created, location: @ybzc }
      else
        format.html { render :new }
        format.json { render json: @ybzc.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /ybzcs/1
  # PATCH/PUT /ybzcs/1.json
  def update
    respond_to do |format|
      if @ybzc.update(ybzc_params)
        format.html { redirect_to @ybzc, notice: 'Ybzc was successfully updated.' }
        format.json { render :show, status: :ok, location: @ybzc }
      else
        format.html { render :edit }
        format.json { render json: @ybzc.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /ybzcs/1
  # DELETE /ybzcs/1.json
  def destroy
    @ybzc.destroy
    respond_to do |format|
      format.html { redirect_to ybzcs_url }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_ybzc
      @ybzc = Ybzc.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def ybzc_params
      params.require(:ybzc).permit(:xm, :xb, :nl, :zjlx, :zjhm, :grbm, :zcsj, :xfjg, :zfje, :sjcdw, :sjcjdwdm, :bz)
    end
end
